const Request = require("../utils/Request.js").default;
const {
	apiServer,groupApiServer
} = require("../config/index.js");

export const http = {
	post(url, data, isFrom = true, isLoading = true,tempToken) {
		return Request(`${apiServer}/${url}`, data, 'POST', isFrom, isLoading,tempToken);
	},
	get(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${apiServer}/${url}`, data, 'GET', isFrom, isLoading,tempToken);
	},
	delete(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${apiServer}/${url}`, data, 'DELETE', isFrom, isLoading,tempToken);
	},
	put(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${apiServer}/${url}`, data, 'PUT', isFrom, isLoading,tempToken);
	},
	options(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${apiServer}/${url}`, data, 'OPTIONS', isFrom, isLoading,tempToken);
	},
	head(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${apiServer}/${url}`, data, 'HEAD', isFrom, isLoading,tempToken);
	},
	trace(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${apiServer}/${url}`, data, 'TRACE', isFrom, isLoading,tempToken);
	},
	connect(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${apiServer}/${url}`, data, 'CONNECT', isFrom, isLoading,tempToken);
	},
}
export const groupHttp = {
	post(url, data, isFrom = true, isLoading = true,tempToken) {
		return Request(`${groupApiServer}/${url}`, data, 'POST', isFrom, isLoading,tempToken);
	},
	get(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${groupApiServer}/${url}`, data, 'GET', isFrom, isLoading,tempToken);
	},
	delete(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${groupApiServer}/${url}`, data, 'DELETE', isFrom, isLoading,tempToken);
	},
	put(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${groupApiServer}/${url}`, data, 'PUT', isFrom, isLoading,tempToken);
	},
	options(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${groupApiServer}/${url}`, data, 'OPTIONS', isFrom, isLoading,tempToken);
	},
	head(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${groupApiServer}/${url}`, data, 'HEAD', isFrom, isLoading,tempToken);
	},
	trace(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${groupApiServer}/${url}`, data, 'TRACE', isFrom, isLoading,tempToken);
	},
	connect(url, data, isFrom = true,isLoading = true,tempToken) {
		return Request(`${groupApiServer}/${url}`, data, 'CONNECT', isFrom, isLoading,tempToken);
	},
}
